﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TouchCi : MonoBehaviour {

	// Use this for initialization
	public bool Follow;
	public GameObject player1;
	public int offsetx;
	public int offsety;
	public int offsetz;

	void Start () {
		offsetx = 63;
		offsety = 20;
		offsetz = -8;
	}
	
	// Update is called once per frame
	void Update () {
		if(Follow)
		{
			transform.position = new Vector3 (player1.transform.position.x+offsetx, player1.transform.position.y+offsety, player1.transform.position.z+offsetz);
		}
	}

	void OnTriggerEnter(Collider collider)
	{
		if(collider.gameObject.tag == "Player")
		{
			Follow = true;
		}
	}
}
